-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding custom changes to grammes fork #1
Conversation
i've also added test for a custom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our version is too old - even older than K6scope itself i believe (at least more than 4 years) i have reviewed and commented on what i believe how the two versions should be merged but i lack the context for these changes so im importing them and leaving them here for all stakeholders to decide unanimously around these. my opinions are in the comments.
my preference would be to not introduce so many changes because from what i have seen, original library provides all methods to attain the goals we are with our custom changes except for type ones (maybe those too but not able to comment confidently).
gremconnect/response.go
Outdated
|
||
err = responseDetectError(resp.Code, message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file were removed here
should be put back imo
gremconnect/response_test.go
Outdated
@@ -77,7 +77,6 @@ var ( | |||
{ | |||
"requestId": "d2476e5b-b2bc-6a70-2647-3991f68ab415", | |||
"status": { | |||
"message": "Some error", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file were removed here
should be put back imo
gremerror/networkerror.go
Outdated
@@ -26,15 +26,13 @@ import "strconv" | |||
type NetworkError struct { | |||
statusCode int | |||
msg string | |||
origMsg string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file were removed here
should be put back imo
manager/misc.go
Outdated
@@ -21,8 +21,6 @@ | |||
package manager | |||
|
|||
import ( | |||
"errors" | |||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think this change will be accepted by maintainers of this repo
query/traversal/addproperty.go
Outdated
@@ -32,11 +38,42 @@ package traversal | |||
// Property(interface{} (Object), interface{} (Object), ...interface{} (Object)) | |||
// Property(Cardinality, string (Object), interface{} (Object), ...interface{} (Object)) | |||
func (g String) Property(objOrCard interface{}, obj interface{}, params ...interface{}) String { | |||
fullParams := make([]interface{}, 0, len(params)+2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe that this change should be reverted..it's already handled by library in a much better design after refactoring..
@@ -0,0 +1,14 @@ | |||
package traversal | |||
|
|||
// StringStep adds a custom string to the traversal. This is not a gremlin step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added by @MDanialSaleem will add tests for it
. "github.com/smartystreets/goconvey/convey" | ||
) | ||
|
||
func TestStringStep(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests for functionality added by @MDanialSaleem
@@ -88,6 +88,10 @@ func (g *String) AddStep(step string, params ...interface{}) { | |||
g.buffer.Write(t) | |||
case string: | |||
g.buffer.WriteString("\"" + strings.ReplaceAll(t, "\"", "\\\"") + "\"") | |||
case int64, uint64: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the change in refactored newer version here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of comments
edge1 := EdgeWithPropsAndLabel{ | ||
Label: "testLbl", | ||
Id: tstoutVID, | ||
Properties: []interface{}{"tstIntrf1", 7777, "tstIntrf2", 9876}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably include a set property with a value of type e.g []int
or []string
and []interface{}
to make sure they are handled correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properties are a list of interface and we cannot send int as interface, can we?
query/traversal/addproperty.go
Outdated
|
||
if len(params) > 0 { | ||
for _, p := range params { | ||
switch p.(type) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we explicitly check for float as well?
WriteBufferSize: 1024 * 8, // Set up for large messages. | ||
ReadBufferSize: 1024 * 8, // Set up for large messages. | ||
WriteBufferSize: 1024 * 256, // Set up for large messages. | ||
ReadBufferSize: 1024 * 256, // Set up for large messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should make this configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add another method that takes this as param as input? Otherwise we'll have to modify this signature which might not work for upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for now, we can let it be. There needs to be a more detailed investigation into why we changed what we changed, and if there is a better way to make those changes, before we can merge this to upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried this but this needs more parameterizing than it looks so i reverted my changes. i think it's better to open up this issue on grammes and then see how it goes
go.uber.org/zap v1.9.1 | ||
) | ||
|
||
replace github.com/northwesternmutual/grammes v1.2.0 => github.com/Kaleidoscope-Inc/grammes v1.2.1-0.20230221065140-059981b86c6f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this package attempts to refer to an older version of itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was an attempt to not change module everywhere since we want it to use our changes but it failed because go has problems with moving on from her ex - i decided to create a separate branch and use this in our code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see that makes sense. That probably has to do with go's package mechanism + forking. Anyway, LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one minor comment otherwise lgtm
https://k6scope.atlassian.net/browse/BLUEP-175
This PR adds custom changes made in https://gitlab.com/kaleidoscope.root/grammes-gremlin to this fork